Tootfinder

Opt-in global Mastodon full text search. Join the index!

No exact results. Similar results found.
@aral@mastodon.ar.al
2024-02-23 16:48:05

Kitten breaking change: Route handlers, etc., now take parameter objects
Just pushed the API updates I’d posted about earlier to main and to the latest Kitten release.
This change affects:
- Route handlers (all types of routes)
- `onConnect()` handlers
- The default export on main.script.js files
I’ve updated all the examples, documentation, etc., on Kitten to use the new API but if you see anything I’ve missed, please let me know.

Screenshot of the ubiquitous counter example (Kitten version) in Kitten’s readme on https://codeberg.org/kitten/app:

1. Create a directory for the example and enter it:

mkdir counter
cd counter

2. Create a file called index.page.js and add the following content to it:

if (kitten.db.counter === undefined) kitten.db.counter = { count: 0 }

export default () => kitten.html`
  <page css>
  <h1>Counter</h1>
  <${Count} />
  <button name='update' connect data='{value: -1}' aria-label='decrement'>…